<?php

	if(isset($_SESSION["user"]) == false)
	{
		echo '<script type = "text/javascript">';
		echo 'location = "../../index.php";';
		echo '</script>';
	}else{
		$user = unserialize($_SESSION['user']);
		$role=$user->getRole();
		if($role!="Admin")
		{
			echo '<script type = "text/javascript">';
			echo 'location = "../../index.php";';
			echo '</script>';
		}
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
	function HuyEdit()
	{
		location = "?act=2";
	}
	function HuyEditDMSP()
	{
		location = "?act=3";
	}
	function HuyEditCH()
	{
		location = "?act=4";
	}
	function ThemSeller()
	{
		location = "?act=5&sk=1";
	}	
	function ThemNSX()
	{
		location="?act=7&sk=1";
	}
	function ThemLSP()
	{
		location="?act=7&sk=4";
	}
	function ThemCH()
	{
		location="?act=9&sk=1";
	}
	
</script>
</head>

<body>
<div class="top">
		QUẢN LÝ WEBSITE
</div>
<div>
	<table width="1010"  cellspacing="0">
		<tr class="menu">
			<td width="150">
				<a href="?act=1">Admin Home</a>
			</td>
			<td width="150">
				<a href="?act=2">QL Tài khoản</a>
			</td>
			<td width="190">
				<a href="?act=3">QL Danh Mục SP</a>
			</td>
			<td width="180">
				<a href="?act=4">QL Cấu Hình SP</a>
			</td>
			<td >
				
			</td>
	  </tr>
	</table>
</div>
<?php
		if(isset($_GET['act']))
	{
		$page=$_GET['act'];
		switch ($page)
		{
			case 1:
				include("inca/incHome.php");
				break;
			case 2:
				include("inca/incQLTaiKhoan.php");
				break;
			case 3:
				include("inca/incQLDMSP.php");
				break;
			case 4:
				include("inca/incQLCH.php");
				break;
			case 5:
				include("inca/incEditTK.php");
				break;
			case 6:
				include("inca/xlEditTK.php");
				break;
			case 7:
				include("inca/incEditDMSP.php");
				break;
			case 8:
				include("inca/xlEditDMSP.php");
				break;
			case 9:
				include("inca/incEditCH.php");
				break;
			case 10:
				include("inca/xlEditCH.php");
				break;
			default:
				include("inca/incHome.php");
				break;	
		}
	}
?>
</body>
</html>